<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>碧家</title>
<link href="css/head.css" type="text/css" rel="stylesheet">
<link href="css/vip.css" type="text/css" rel="stylesheet">
<link href="css/style.css" type="text/css" rel="stylesheet">
<link href="css/index.css" type="text/css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/tuangou.css" rel="stylesheet" type="text/css">
<link href="css/style.css" type="text/css" rel="stylesheet">
<link href="css/foot.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/request.js"></script>
<script type="text/javascript">
function checkSerach(){
var productname = document.getElementById("title").value;
	if(productname == null || productname == ""){
		
		alert('请输入商品名称');
		return false;
	}	
	else{
		if(productname.replace(/\s/g,"") == ""){
			window.location.href = "menu.do?method=MenuShow";
			return false;
		}else{
			return true;
		}
	
	}
}

//跳转到指定页次
function gotoPage(pageCount){
	var categoryId='';
	<#if categoryId?exists>
		categoryId=${categoryId};
	</#if>
	var pageSize=${pageSize};
	var sort='';
	var layout='';
	if(categoryId!=''){
		var queryStr="categoryId="+categoryId;
	}
	queryStr=queryStr+"&pageCount="+pageCount;
	queryStr=queryStr+"&pageSize="+pageSize;
	queryStr=queryStr+"&layout=table"+"&sort=default"
	//alert("mycollection.htm?"+queryStr);
	window.location.href="mycollection.htm?"+queryStr;
}
//下一页
function gotoNext(){
	var totalPageNum=${totalPageNum};
	var pageCount=${pageCount};
	if(pageCount==totalPageNum){
		alert("当前已是最后一页");
		return;
	}
	gotoPage(pageCount+1);
}

function gotoPre(){
	var pageCount=${pageCount};
	if(pageCount==1){
		alert("当前已是第一页");
		return;
	}
	gotoPage(pageCount-1);
}
//Enter按下跳转到指定页面
function go(obj,event){
	var keynum
	
	if(window.event) // IE
	{
		keynum = event.keyCode
	}
	else if(event.which) // Netscape/Firefox/Opera
	{
		keynum = event.which
	}
	
	if(keynum!=13)//Enter
		return;
	gotoPage(obj.value);
}

//增加到商品购物车并刷新当前页面
function addToCart(itemId,useshape){
	var qty=document.getElementById("qty"+itemId).value;
	var shape=null;
	if(useshape==true){
		var shapeSelect=document.getElementById("shape"+itemId);
		shape=shapeSelect.options[shapeSelect.selectedIndex].value;
	}
	else{
		shape=2;
	}
	var url="addCart.do?itemId="+itemId+"&shape="+shape+"&qty="+qty;
	request(url,reloadPage);
}
function removeColl(collectionId){
	if(!confirm("确定要移除该收藏的商品?"))
		return;
	var url="removeCollection.do?idno="+collectionId
	request(url,reloadPage);
}
//刷新当前页面
function reloadPage(){
	window.location.reload();
}

</script>
</head>
<body>
<#------------------------------ include file  -------------------------------------------->
<#include "/WEB-INF/view/header.ftl" />
<#------------------------------  include file  ------------------------------------------->
<div class="vip_outer1">
  <div class="viphead_left"></div>
  <div class="viphead_midst1">
    <div class="viphead_name">${Session.user.regName?if_exists} / ${Session.user.memberno?if_exists}的VIP专属超市</div>
    <div class="viphead_navouter">
      <table class="viphead_nav" width="100%" border="0" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td class="viphead_title1_2"><a href="mycollection.htm" class="viphead_link">我的收藏</a></td>
            <td class="viphead_title2"><a href="myProfile.htm" class="viphead_link">我的个人信息</a></td>
            <td class="viphead_title2"><a href="myOrder.htm" class="viphead_link">我的家庭帐本</a></td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
  <div class="viphead_midst2"></div>
  <div class="viphead_midst3">
    <ul>
      <li><a href="#" class="viphead_link2">什么是VIP专属超市?</a></li>
      <li><a href="#" class="viphead_link2">如何快速建立VIP专属超市?</a></li>
    </ul>
  </div>
  <div class="viphead_right"></div>
</div>
<div class="share_body">
  <div class="share_left">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td class="index_cat01">商品分类</td>
        </tr>
        <tr>
          <td class="index_cat02" valign="top" align="center"><table style="margin: 10px auto 0pt;" width="160" align="center" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td class="vip_catleft1"></td>
                  <td class="vip_catright1"><a href="mycollection.htm">全部商品</a></td>
                  <!-- <td class="vip_catright2">80种</td> -->
                </tr>
                <tr>
                  <td colspan="3"><table class="vip_cat_table" width="90%" align="center" border="0" cellpadding="0" cellspacing="0">
                      <!-- 
							  <tr>
								<td class="vip_catleft2">您<span class="vip_red">收藏</span>了80种商品</td>
							  </tr>
							   -->
                      <tbody>
                        <tr>
                          <td class="vip_catleft2"><span class="vip_red"><a href="allCategoriesView.htm">收藏更多商品</a></span></td>
                        </tr>
                        <tr>
                          <td class="vip_catleft2"><span class="vip_red"><a href="oosReport.htm">缺货登记</a></span></td>
                        </tr>
                        <tr>
                          <td class="vip_catleft2"><span class="vip_red"><a href="exportCollection.do">下载我收藏的商品</a></span></td>
                        </tr>
                      </tbody>
                    </table></td>
                </tr>
                <#list categories as category>
                <tr>
                  <td class="vip_catleft1"></td>
                  <td class="vip_catright1"><a href="mycollection.htm?categoryId=${category.item_clsno}" class="vip_link">${category.item_clsname}</a></td>
                </tr>
                <tr>
                  <td colspan="3"><table class="vip_cat_table" width="90%" align="center" border="0" cellpadding="0" cellspacing="0">
                      <tbody>
                        <tr>
                          <td class="vip_catleft2"><span class="vip_red"><a href="listItem.htm?categoryId=${category.item_clsno}01">收藏本类更多商品</a></span></td>
                        </tr>
                      </tbody>
                    </table></td>
                </tr>
               	</#list>
              </tbody>
            </table></td>
        </tr>
        <tr>
          <td background="img/index_02.gif" height="7"></td>
        </tr>
      </tbody>
    </table>
  </div>
  <div class="share_right">
    <div class="share_fenye">
      <div class="share_fenye_left"></div>
      <div class="share_fenye_midst">
        <div class="share_fenye_content">
        共${totalNum}条&nbsp;&nbsp;   &nbsp;&nbsp; 
        <#if (totalNum>0)>
        
	        <a href="#" onClick="gotoPre()">上一页</a> <#assign before=0>
	          <#assign after=0>
	          <#list 1..totalPageNum as i>
	          <#if ((i<3)||((totalPageNum-i)<3)||((pageCount-i)<3&&(pageCount-i)>-3))> <a href="#" onClick="gotoPage(${i})"> <#if pageCount==i> <span class="share_fenyeword">${i}</span> <#else>
	          ${i}
	          </#if> </a> <#else>
	          <#if ((i-pageCount)<0)>
	          <#if (before==0)>
	          ...
	          <#assign before=1>      				
	          </#if>
	          <#else>
	          <#if (after==0)>
	          ...
	          <#assign after=1>      				
	          </#if>
	          </#if>
	          </#if>
	          </#list> <a href="#" onClick="gotoNext()">下一页</a> 到第
	          <input name="pagenum" class="plist_input2" value="${pageCount}" type="text" width="5" onKeyDown="go(this,event)">
	          页
         </#if>
          
        </div>
        <div class="share_fenye_pailie"></div>
      </div>
      <div class="share_fenye_right"></div>
    </div>
    
    <#list collections?if_exists as collection>
    <#assign item=items[collection.itemId]>
    <table class="pro_search" width="100%" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td valign="middle" width="6%" align="center">
          
          </td>
          
          <td valign="middle" width="20%" align="center" height="120"><table class="pli_table3" width="110" border="0" cellpadding="0" cellspacing="0" height="110">
              <tbody>
                <tr>
                  <td valign="middle" align="center"><a href="item_${collection.itemId}.htm" target="_blank"><img src="http://image.b2office.com.cn/goods/middle/${collection.itemId}.jpg" title="王老吉 310ml*6" width="110" border="0" height="110"></a></td>
                </tr>
              </tbody>
            </table></td>
          <td valign="top" width="50%" align="center"><table width="97%" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td colspan="2" class="plist_title2" align="left">${item?if_exists.titles}</td>
                </tr>
                <tr>
                  <td width="40%" align="left">碧家价：
                  <#if item.usenewunit==1>
                    <#if item.useshape==1>
                    ${item.b2hprice}元/${item.unit_no}
                    <#else>
                   ${item.b2hprice*item.midqty}元/${item.newunit}
                    </#if>
                    <#else>
                    ${item.b2hprice}元/${item.unit_no}
                  </#if></td>
                </tr>
                <tr>
                  <td width="40%" align="left">数量:
                    <input id="qty${item.item_no}" name="qty${item.item_no}" value="1" class="plist_input2_2" type="text">
                    <#if item.usenewunit==1>
                    <#if item.useshape==1>
                    <select name="shape${item.item_no}" id="shape${item.item_no}">
                      <option value="3">大${item.newunit} 约${item.bigqty}${item.unit_no}</option>
                      <option value="2" selected>中${item.newunit} 约${item.midqty}${item.unit_no}</option>
                      <option value="1">小${item.newunit} 约${item.smlqty}${item.unit_no}</option>
                    </select>
                    <#else>
                    ${item.newunit}
                    </#if>
                    <#else>
                    ${item.unit_no}
                    </#if>
                    </td>
                </tr>
                <tr>
                  <td width="20%" align="left">配送周期：${item.deliverday?if_exists}小时</td>
                </tr>
              </tbody>
            </table></td>
          <td valign="middle" align="center"><table width="90%" border="0" cellpadding="0" cellspacing="0" height="60">
              <tbody>
                <tr> </tr>
                <tr>
                  <td align="left"><a href="javascript:addToCart(${item.item_no},<#if (item.usenewunit==1)&&(item.useshape==1)>true<#else>false</#if>)"><img src="img/plist_06.gif" width="67" border="0" height="21"></a></td>
                  <td align="right"><a href="javascript:removeColl(${collection.idno})"><img src="img/cancel.jpeg" width="67" border="0" height="21"></a></td>
                </tr>
              </tbody>
          </table></td>
        </tr>
        <tr>
          <td colspan="4" valign="middle" height="8"><table class="share_fengxian_outer" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td class="share_fengexian"></td>
                </tr>
              </tbody>
            </table></td>
        </tr>
      </tbody>
    </table>
    </#list>
    
    <div class="share_fenye">
      <div class="share_fenye_left"></div>
      <div class="share_fenye_midst">
        <div class="share_fenye_content">
        共${totalNum}条&nbsp;&nbsp;   &nbsp;&nbsp; 
        <#if (totalNum>0)>
        
	        <a href="#" onClick="gotoPre()">上一页</a> <#assign before=0>
	          <#assign after=0>
	          <#list 1..totalPageNum as i>
	          <#if ((i<3)||((totalPageNum-i)<3)||((pageCount-i)<3&&(pageCount-i)>-3))> <a href="#" onClick="gotoPage(${i})"> <#if pageCount==i> <span class="share_fenyeword">${i}</span> <#else>
	          ${i}
	          </#if> </a> <#else>
	          <#if ((i-pageCount)<0)>
	          <#if (before==0)>
	          ...
	          <#assign before=1>      				
	          </#if>
	          <#else>
	          <#if (after==0)>
	          ...
	          <#assign after=1>      				
	          </#if>
	          </#if>
	          </#if>
	          </#list> <a href="#" onClick="gotoNext()">下一页</a> 到第
	          <input name="pagenum" class="plist_input2" value="${pageCount}" type="text" width="5" onKeyDown="go(this,event)">
	          页
         </#if>
        
        </div>
        <div class="share_fenye_pailie"></div>
      </div>
      <div class="share_fenye_right"></div>
    </div>
  </div>
</div>
<div class="foot_outer1">
  <div class="foot02"></div>
  <div class="foot02"></div>
  <div class="foot02"></div>
  <div class="foot02"></div>
  <div class="foot03"></div>
</div>
<#------------------------------ include file  -------------------------------------------->
<#include "/WEB-INF/view/footer.ftl" />
<#------------------------------  include file  ------------------------------------------->
</body>
</html>
